using System;
using System.Collections;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[ARStructTypeInfo(Name = "ARActiveLinkInfoStruct", NumberOfMembers = 24u), ClassInterface, Guid("cc0d01c8-68e0-4c83-861e-aff86f092cfa"), ProgId("BMC.ARSystem.ActiveLink")]
	public class ActiveLink
	{
		[Guid("70664c68-b8c9-4576-88c4-3af762594335")]
		public enum MemberFlags
		{
			Name = 1,
			NewName,
			Order = 4,
			FormList = 8,
			Permissions = 16,
			ExecuteMask = 32,
			ControlField = 64,
			FocusField = 128,
			Enabled = 256,
			RunIfQualification = 512,
			IfActions = 1024,
			ElseActions = 2048,
			HelpText = 4096,
			Owner = 8192,
			ChangeDiary = 16384,
			Properties = 32768,
			LastUpdateTime = 65536,
			LastModifiedBy = 131072,
			ErrorHandlerOption = 262144,
			ErrorHandlerName = 524288,
			ModificationLogLabel = 1048576,
			AssignedGroupList = 2097152,
			AssignedName = 4194304
		}
		[ARStructMemTypeInfo(Name = "activeLinkName", Offset = 0u)]
		private string _name;
		[ARStructMemTypeInfo(Name = "order", Offset = 1u)]
		private uint _order;
		[ARStructMemTypeInfo(Name = "formList", Offset = 2u)]
		private ArrayList _formList;
		[ARStructMemTypeInfo(Name = "groupList", Offset = 3u)]
		private ArrayList _permList;
		[ARStructMemTypeInfo(Name = "assignedGroupList", Offset = 4u)]
		private ArrayList _assignedGroupList;
		[ARStructMemTypeInfo(Name = "executeMask", Offset = 5u)]
		private uint _executeMask;
		[ARStructMemTypeInfo(Name = "controlField", Offset = 6u)]
		private uint _controlField;
		[ARStructMemTypeInfo(Name = "focusField", Offset = 7u)]
		private uint _focusField;
		[ARStructMemTypeInfo(Name = "enable", Offset = 8u)]
		private bool _enable;
		[ARStructMemTypeInfo(Name = "runIfQual", Offset = 9u)]
		private string _runIfQual;
		[ARStructMemTypeInfo(Name = "ifActions", Offset = 10u)]
		private ArrayList _ifActions;
		[ARStructMemTypeInfo(Name = "elseActions", Offset = 11u)]
		private ArrayList _elseActions;
		[ARStructMemTypeInfo(Name = "helpText", Offset = 12u)]
		private string _helpText;
		[ARStructMemTypeInfo(Name = "timestamp", Offset = 13u)]
		private DateTime _timestamp;
		[ARStructMemTypeInfo(Name = "owner", Offset = 14u)]
		private string _owner;
		[ARStructMemTypeInfo(Name = "lastChanged", Offset = 15u)]
		private string _lastChanged;
		[ARStructMemTypeInfo(Name = "changeDiary", Offset = 16u)]
		private DiaryList _changeDiary;
		[ARStructMemTypeInfo(Name = "objPropList", Offset = 17u)]
		private IDictionary _objPropList;
		[ARStructMemTypeInfo(Name = "modificationLogLabel", Offset = 18u)]
		private string _modificationLogLabel;
		[ARStructMemTypeInfo(Name = "assgnName", Offset = 19u)]
		private string _assgnName;
		private string _newName;
		private BitVector32 _modifyFlags;
		private int _errorHandlerOption;
		private string _errorHandlerName;
		public string Name
		{
			get
			{
				return this._name;
			}
			set
			{
				if (this._name == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 1);
				this._name = value;
			}
		}
		public string NewName
		{
			get
			{
				return this._newName;
			}
			set
			{
				if (this._newName == value || this._newName == this._name)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 2);
				this._newName = value;
			}
		}
		public uint Order
		{
			get
			{
				return this._order;
			}
			set
			{
				if (this._order == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 4);
				this._order = value;
			}
		}
		public ArrayList FormList
		{
			get
			{
				return this._formList;
			}
			set
			{
				if (this._formList == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 8);
				this._formList = value;
			}
		}
		public string PrimaryForm
		{
			get
			{
				return (string)this.FormList.get_Item(0);
			}
		}
		public ArrayList Permissions
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 16);
				return this._permList;
			}
			set
			{
				if (this._permList == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 16);
				this._permList = value;
			}
		}
		public ArrayList AssignedGroupList
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 2097152);
				return this._assignedGroupList;
			}
			set
			{
				if (this._assignedGroupList == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 2097152);
				this._assignedGroupList = value;
			}
		}
		public uint ExecuteMask
		{
			get
			{
				return this._executeMask;
			}
			set
			{
				if (this._executeMask == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 32);
				this._executeMask = value;
			}
		}
		public uint ControlField
		{
			get
			{
				return this._controlField;
			}
			set
			{
				if (this._controlField == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 64);
				this._controlField = value;
			}
		}
		public uint FocusField
		{
			get
			{
				return this._focusField;
			}
			set
			{
				if (this._focusField == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 128);
				this._focusField = value;
			}
		}
		public bool Enabled
		{
			get
			{
				return this._enable;
			}
			set
			{
				if (this._enable == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 256);
				this._enable = value;
			}
		}
		public string RunIfQualification
		{
			get
			{
				return this._runIfQual;
			}
			set
			{
				if (this._runIfQual == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 512);
				this._runIfQual = value;
			}
		}
		public ArrayList IfActions
		{
			get
			{
				return this._ifActions;
			}
			set
			{
				if (this._ifActions == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 1024);
				this._ifActions = value;
			}
		}
		public ArrayList ElseActions
		{
			get
			{
				return this._elseActions;
			}
			set
			{
				if (this._elseActions == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 2048);
				this._elseActions = value;
			}
		}
		public string HelpText
		{
			get
			{
				return this._helpText;
			}
			set
			{
				if (this._helpText == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 4096);
				this._helpText = value;
			}
		}
		public string Owner
		{
			get
			{
				return this._owner;
			}
			set
			{
				if (this._owner == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 8192);
				this._owner = value;
			}
		}
		public DiaryList ChangeDiary
		{
			get
			{
				return this._changeDiary;
			}
			set
			{
				if (this._changeDiary == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 16384);
				this._changeDiary = value;
			}
		}
		public IDictionary Properties
		{
			get
			{
				return this._objPropList;
			}
			set
			{
				if (this._objPropList == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 32768);
				this._objPropList = value;
			}
		}
		public DateTime LastUpdateTime
		{
			get
			{
				return this._timestamp;
			}
		}
		public string LastModifiedBy
		{
			get
			{
				return this._lastChanged;
			}
		}
		public string ModificationLogLabel
		{
			get
			{
				return this._modificationLogLabel;
			}
			set
			{
				if (this._modificationLogLabel == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 1048576);
				this._modificationLogLabel = value;
			}
		}
		public string AssignedName
		{
			get
			{
				return this._assgnName;
			}
			set
			{
				if (this._assgnName == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 4194304);
				this._assgnName = value;
			}
		}
		[ComVisible(false)]
		public BitVector32 MembersModified
		{
			get
			{
				return this._modifyFlags;
			}
			set
			{
				this._modifyFlags = value;
			}
		}
		public int MembersModifiedAsInt
		{
			get
			{
				return this._modifyFlags.get_Data();
			}
			set
			{
				this._modifyFlags = new BitVector32(value);
			}
		}
		public int ErrorHandlerOption
		{
			get
			{
				return this._errorHandlerOption;
			}
			set
			{
				this._errorHandlerOption = value;
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 262144);
				if (this._errorHandlerOption == 0)
				{
					this.ErrorHandlerName = "";
				}
			}
		}
		public string ErrorHandlerName
		{
			get
			{
				return this._errorHandlerName;
			}
			set
			{
				this._errorHandlerName = value;
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 524288);
			}
		}
		public ActiveLink()
		{
			this._modifyFlags = new BitVector32(257);
		}
		public ActiveLink(string name) : this()
		{
			this.Name = name;
		}
		internal ActiveLink(object[] rawData, Server server)
		{
			server.Session.CurrentObjectType = Server.ObjectType.ActiveLink;
			this.Name = (string)Util.GetAt(rawData, new int[]
			{
				3
			});
			this.Order = (uint)Util.GetAt(rawData, new int[]
			{
				4
			});
			this.FormList = new ArrayList((object[])Util.GetAt(rawData, new int[]
			{
				5,
				1
			}));
			server.Session.SecondaryServerName = Session.MakeServerName(server.ServerName, server.ServerPort);
			server.Session.CurrentLocalForm = this.PrimaryForm;
			server.Session.CurrentRemoteForm = this.PrimaryForm;
			server.Session.CurrentFieldId = 8u;
			this.Permissions = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("System.UInt32"), (object[])Util.GetAt(rawData, new int[]
			{
				6
			}), server);
			this.AssignedGroupList = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("Unknown"), (object[])Util.GetAt(rawData, new int[]
			{
				7
			}), server);
			this.ExecuteMask = (uint)Util.GetAt(rawData, new int[]
			{
				8
			});
			this.ControlField = (uint)Util.GetAt(rawData, new int[]
			{
				9
			});
			this.FocusField = (uint)Util.GetAt(rawData, new int[]
			{
				10
			});
			this.Enabled = (Convert.ToInt32(Util.GetAt(rawData, new int[]
			{
				11
			})) != 0);
			this.RunIfQualification = server.FormatQualification(this.PrimaryForm, Util.GetAt(rawData, new int[]
			{
				12
			}));
			ARTypeMgr arg_20D_0 = ARTypeMgr.Instance;
			Type arg_20D_1 = typeof(HybridDictionary);
			string arg_20D_2 = "System.Int32";
			int[] keyIndex = new int[1];
			this.Properties = arg_20D_0.BuildCustomDictionaryFromVariant(arg_20D_1, arg_20D_2, keyIndex, "ARValue", new int[]
			{
				1
			}, (object[])Util.GetAt(rawData, new int[]
			{
				20
			}), server);
			if (this.Properties != null && this.Properties.Contains(60016))
			{
				server.Session.CurrentOpenWindowSampleServerForms = Util.ImportOpenWindowSampleServerForms((string)this.Properties.get_Item(60016));
			}
			this.HelpText = (string)Util.GetAt(rawData, new int[]
			{
				15
			});
			this._timestamp = Util.GetDateTime(Convert.ToUInt32(Util.GetAt(rawData, new int[]
			{
				16
			})));
			this.Owner = (string)Util.GetAt(rawData, new int[]
			{
				17
			});
			this._lastChanged = (string)Util.GetAt(rawData, new int[]
			{
				18
			});
			this.ChangeDiary = DiaryList.Decode((string)Util.GetAt(rawData, new int[]
			{
				19
			}));
			server.Session.CurrentActionIndex = 0;
			this.IfActions = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("BMC.ARSystem.Action"), (object[])Util.GetAt(rawData, new int[]
			{
				13
			}), server);
			if (this.Properties != null && this.Properties.Contains(60017))
			{
				server.Session.CurrentOpenWindowSampleServerForms = Util.ImportOpenWindowSampleServerForms((string)this.Properties.get_Item(60016));
			}
			server.Session.CurrentActionIndex = 0;
			this.ElseActions = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("BMC.ARSystem.Action"), (object[])Util.GetAt(rawData, new int[]
			{
				14
			}), server);
			this.ErrorHandlerOption = Convert.ToInt32(Util.GetAt(rawData, new int[]
			{
				21
			}));
			this.ErrorHandlerName = (string)Util.GetAt(rawData, new int[]
			{
				22
			});
			this._modifyFlags = new BitVector32(257);
		}
		internal static ActiveLink createInstance(object[] rawData, Server server)
		{
			return new ActiveLink(rawData, server);
		}
	}
}
